package model

import (
	"time"
)

//UserLogin 用户登录结构
type UserLogin struct {
	Username string `json:"username" form:"username" binding:"required,registerUsername"`
	Password string `json:"password" form:"password" binding:"required"`
}

//UserRegistry 用户注册结构
type UserRegistry struct {
	Uid          string    `json:"uid"`
	Username     string    `json:"username" form:"username" binding:"required,registerUsername"`
	Password     string    `json:"password" form:"password" binding:"required,registerPassword"`
	RePassword   string    `json:"re_password" form:"re_password" gorm:"-"`
	Email        string    `json:"email" form:"email" binding:"required,email"`
	LoginIP      string    `json:"login_ip"`
	LoginTime    time.Time `json:"login_time"`
	RegisterTime time.Time `json:"register_time"`
}

//UserLogin 注册表表名
func (UserRegistry) TableName() string {
	return "user_registry"
}

//ChangePassword 更改密码的表单
type ChangePassword struct {
	Oldpassword   string `json:"oldpassword" form:"oldpassword" binding:"required,registerPassword"`
	Newpassword   string `json:"newpassword" form:"newpassword" binding:"required,registerPassword"`
	ReNewpassword string `json:"re_newpassword" form:"re_newpassword" binding:"required,registerPassword"`
}
